require 'watir'
include Watir
require 'test/unit'
class TC_blogsFrontEnd < Test::Unit::TestCase
  	def test_38_CreateBlogUsingButtons_Blogs

    $ie.goto($UniVar)
#No prerequisites required
#test specifics
	$ie.goto($UniVar + '/controlpanel/BlogAdmin/sectionedit.aspx')	
	$ie.text_field(:id, /ctl00_ctl00_TaskRegion_SectionDetails1_SectionDetails1_SectionName/).set('rewriteblog')
	$ie.text_field(:id, /ctl00_ctl00_TaskRegion_SectionDetails1_SectionDetails1_AppKey/).set('rewriteblog')
	$ie.link(:text, 'Save').click
	assert($ie.contains_text('rewriteblog'))
  
  #Delete Blog      
  $ie.goto($UniVar + '/controlpanel/BlogAdmin/Blogs.aspx')
  $ie.wait()
  $ie.link(:text, 'Delete').click_no_wait
  hwnd = $ie.enabled_popup(20)
    if(hwnd)
      w = WinClicker.new
      w.clickWindowsButton_hwnd(hwnd, "OK")
    end  
	end
end